#include <stdio.h>

int reversed(int m){
    int remainder = 0;
    int reserved = 0;

    while(m != 0){
        remainder = m%10;
        reserved = reserved*10+remainder;
        m /= 10;
    }

    return reserved;
}

int add(int m){
    m += reversed(m);
    return m;
}


int main()
{
    int n;
    scanf("%d", &n);

    int count = 0;
    int ans[100] = {0};
    ans[0] = n;

    while(reversed(n) != n){
        n = add(n);
        count += 1;
        ans[count] = n;
    }

    printf("%d\n", count);
    for(int i = 0; i < count; i++) {
        printf("%d--->", ans[i]);
    }
    printf("%d\n", ans[count]);

    return 0;
}
